package com.example.myblog.component;

import com.example.myblog.dto.BlogMessageDTO;
import com.example.myblog.vo.BlogVO;
import org.springframework.stereotype.Component;

/**
 * @author yx
 */
@Component
public class EntityVoToEntityUtil {
    public BlogMessageDTO changeFromBlogVO(BlogVO vo) {
        BlogMessageDTO dto = new BlogMessageDTO();
        dto.setBlogDescription(vo.getDescription());
        dto.setBlogImage(vo.getFirstPicture());
        dto.setBlogText(vo.getContent());
        dto.setBlogTitle(vo.getTitle());
        return dto;
    }
}
